package com.linsen.core.common.constant;

/**
 * 认证URL常量
 *
 * @author zhaoyong
 * @date 2023/3/13
 */
public interface Oauth2Constant {
    String ALL = "/**";

    String OAUTH_ALL = "/oauth/**";

    String OAUTH_AUTHORIZE = "/oauth/authorize";

    String OAUTH_CHECK_TOKEN = "/oauth/check_token";

    String OAUTH_CONFIRM_ACCESS = "/oauth/confirm_access";

    String OAUTH_TOKEN = "/oauth/token";

    String OAUTH_TOKEN_KEY = "/oauth/token_key";

    String OAUTH_ERROR = "/oauth/error";

    String OAUTH_MOBILE = "/oauth/mobile";

    /**
     * 发送短信验证码 或 验证短信验证码时，传递手机号的参数的名称
     */
    String DEFAULT_PARAMETER_NAME_MOBILE = "mobile";

    /**
     * 社交登录，传递的参数名称
     */
    String DEFAULT_PARAMETER_NAME_SOCIAL = "social";

    /**
     * 验证码 key
     */
    String VALIDATE_CODE_KEY = "key";
    /**
     * 验证码 code
     */
    String VALIDATE_CODE_CODE = "code";
    /**
     * 认证类型参数 key
     */
    String GRANT_TYPE = "grant_type";
    /**
     * 登录类型
     */
    String LOGIN_TYPE = "login_type";

    /**
     * 刷新模式
     */
    String REFRESH_TOKEN = "refresh_token";
    /**
     * 授权码模式
     */
    String AUTHORIZATION_CODE = "authorization_code";
    /**
     * 客户端模式
     */
    String CLIENT_CREDENTIALS = "client_credentials";
    /**
     * 密码模式
     */
    String PASSWORD = "password";
    /**
     * 简化模式
     */
    String IMPLICIT = "implicit";

    String SIGN_KEY = "LINSEN";

    String CAPTCHA_KEY = "linsen.captcha.";

    String SMS_CODE_KEY = "linsen.sms.code.";

    String CAPTCHA_HEADER_KEY = "key";

    String CAPTCHA_HEADER_CODE = "code";

    int LOGIN_USERNAME_TYPE = 1;

    int LOGIN_MOBILE_TYPE = 2;

    String HEADER_TOKEN = "Authorization";

    /**
     * 自定义client表名
     */
    String CLIENT_TABLE = "linsen_sys_client";

    String ENCRYPT = "{linsen}";

    String CAPTCHA_ERROR = "验证码不正确";

    String SUPER_ADMIN = "admin";

    /**
     * 基础查询语句
     */
    String CLIENT_BASE = "select client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, " +
            "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity," +
            "refresh_token_validity, additional_information, autoapprove from " + CLIENT_TABLE;

    String FIND_CLIENT_DETAIL_SQL = CLIENT_BASE + " order by client_id";

    String SELECT_CLIENT_DETAIL_SQL = CLIENT_BASE + " where client_id = ?";

    /**
     * 标志
     */
    String FROM = "from";

    /**
     * 内部
     */
    String FROM_IN = "Y";

    /**
     * 权限标识前缀
     */
    String LINSEN_PERMISSION_PREFIX = "linsen.permission.";

    /**
     * 字段描述开始：用户ID
     */
    String LINSEN_USER_ID = "userId";

    /**
     * 用户名
     */
    String LINSEN_USERNAME = "username";

    /**
     * 用户头像
     */
    String LINSEN_AVATAR = "avatar";

    /**
     * 用户权限ID
     */
    String LINSEN_ROLE_ID = "roleId";

    /**
     * 用户类型
     */
    String LINSEN_TYPE = "type";

    /**
     * 租户ID
     */
    String LINSEN_TENANT_ID = "tenantId";
}
